home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
program
/
explorer.lzh
/
explorer.doc
< prev
next >
Wrap
Text File
|
1995-12-20
|
7KB
|
149 lines
Short: Amazing System Explorer/Debugger
Type: dev/e
Author: jason@fsel.com (Jason R. Hulance)
Uploader: jason@fsel.com (Jason R. Hulance)
Explorer 1.0j
=============
Allows you to browse around memory as E objects (which are like C structs).
(The complete distribution of Amiga E [but with a demo compiler] is
available from Aminet, in dev/e. The current version is amigae32a.lha and
amigae32a_extras.lha, with a v3.2e update patch also available.)
Basic function
--------------
You can enter an address and then select the object which is (supposed to
be?) at that address. You can then see the value that each element of the
object contains and follow pointers etc. by double-clicking on the element
(a single click changes the address to the element's address, which is an
offset from the object address you specified). A double-click may
therefore change the object being browsed, so there is a way of returning
to the original object via the "Back Up" button.
The list of objects is created by scanning all the modules in the
'Emodules:' directory and its sub-directories, so you can include your own
objects by putting suitable modules in a sub-directory called, say,
'mymods'.
The address and object can also be specified via ARexx, making Explorer an
extremely useful debugging tool as well as a system browser!
Object layout
-------------
The elements of the selected object are listed in order. If you choose to
see the value of element it will be displayed in hex in parenthesis after
the element, and if you choose to see the element address (an offset from
the object address) it will be displayed after an '@'. (Use the "Elements"
menu to select which you want to see -- the default is just the value.)
Where to start
--------------
The buttons on the bottom of the GUI give some interesting starting points:
1) "Exec." Views the address stored in the 'execbase' global variable as
an 'execbase' object. The exec.library is the most fundamental Amiga
system library, and 'execbase' is its corresponding library base object.
2) "Graphics." Same as 1) but for the 'gfxbase' variable and object for
the graphics.library.
3) "Intuition." Same as 1) but for the 'intuitionbase' variable and object
for the intuition.library.
4) "This Process." Views the 'process' object for the running Explorer
program!
Simple types
------------
The "CHAR", "INT" and "LONG" buttons view the contents of the address as if
it were a pointer to the corresponding type, and fills in the 'Hex:',
'Decimal:' and 'String:' texts with the value(s) being pointed at. (If you
double-click on an element of an object with one of these types [or PTR TO
them] then this is done automatically. The contents of the PTR or LONG
value are also copied to the current address to make following arrays
etc. easier.)
"BSTR" is similar to "CHAR" but it first converts the address from a BCPL
pointer and then skips over the length byte. "BADDR" just converts the
address to a BCPL pointer.
"Prev" and "Next" treat the address as pointing to an array of the type
last requested (i.e., an object or simple type). "Prev" moves the address
back to the previous element in the array, and "Next" moves it on to the
next.
ARexx
-----
The "Reply" button manually replies to an ARexx message that may have been
received. You can also let Explorer automatically reply to these messages
by selecting the option under the ARexx menu, but the manual method is best
since you can be sure that the pointers remain valid while you browse
(since the calling program is halted). Once you've replied to a message
the calling program is free to scribble all over the memory it just pointed
you at.
A module 'sendexplorer.m' is supplied to simplify the debugging aspect of
Explorer. It defines a single function, 'sendExplorer', which you call
with the address and object name you are interested in. The third,
optional parameter is a message port for replies. If you don't supply this
then a temporary port is created for the duration of the function call.
(The purpose of this parameter is to allow you to re-use the same port
during your program if you call 'sendExplorer' a lot.) An example call is:
sendExplorer(packet, 'dospacket')
Example program
---------------
To show how useful Explorer can be, there is a modified version of the
'empty' handler supplied. This uses the above call to 'sendExplorer' to
communicate the value of the packet currently being processed. Since the
handler is not a full process there would normally be no simple way of
debugging it or examining the packets as they arrive (none of the DOS
functions, such as printing text, are available to it). But it can send
messages to ARexx and thus to Explorer.
To try it out:
1) Make sure ARexx is up (by running RexxMast, if necessary).
2) Start up Explorer using,
run explorer
3) Now copy 'empty-handler' to L:,
copy empty-handler L:
4) Mount it using,
mount empty: from empty.mountlist
5) Use the handler,
type empty:10
6) Look at Explorer. It will be displaying the first packet. Browse
around it, remembering that most elements will be BCPL strings.
7) Press "Reply" to reply to this message.
8) Another packet arrives and the message is sent to Explorer.
9) Repeat 6)-8) until the 'type' command finishes and you get the Shell
prompt back.
Legal stuff
-----------
The programs and modules in this archive are all
Copyright (C) 1995, Jason R. Hulance.
You are free to use the modules in your programs, whether they are freeware
or commercial. However, if you want to distribute any of this archive you
must include it all, unmodified, together with this file.
And as the good man Wouter puts it: "No guarantees, no warranty. If you
manage to drown your pet goldfish using Explorer, or Explorer fails to be
suitable for ordering pizzas, that's entirely your problem. Whatever
happens, don't blame it on me."
Wouter-ware
-----------
In spite of the above, this product is also Wouter-ware. Wouter (van
Oortmerssen) is the author of Amiga E, the language which makes these
things possible. If you find Explorer really useful and would like to show
your appreciation then please register your Amiga E. We all need to
encourage the real stars like Wouter to continue their great work on the
Amiga.
Once again, the complete distribution of Amiga E (with a demo compiler) is
available from Aminet, in dev/e. The current version is amigae32a.lha and
amigae32a_extras.lha, with a v3.2e update patch also available.